from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import QDialog

from my_utils.utils_class.GameOverDialog import GameOverDialog
from my_utils.utils_funtions.exit_game import exit_to_main_menu


def on_game_over(self, is_good_ending):
    self.xyf_button.cleanup()
    self.jbc_button.cleanup()
    dlg = GameOverDialog(is_good_ending)
    result = dlg.exec_()
    if result == QDialog.Accepted:
        exit_to_main_menu(self)
    elif result == QDialog.Rejected:
        QCoreApplication.quit()  # 退出游戏
    pass

#
# def on_ct_died(self):
#     self.xyf_button.cleanup()
#     self.jbc_button.cleanup()
#     dlg = GameOverDialog()
#     result = dlg.exec_()
#     if result == QDialog.Accepted:
#         exit_to_main_menu(self)
#     elif result == QDialog.Rejected:
#         QCoreApplication.quit()  # 退出游戏
#     pass
